<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body style="display: flex;justify-content: center;">

    <canvas id="myCanvas" width="500" height="445" style="border:1px solid #c3c3c3;">
        您的浏览器不支持 HTML5 canvas 标签。
    </canvas>

    <script>

        var c = document.getElementById("myCanvas");
        var ctx = c.getContext("2d");
        // ctx.fillStyle="#FF0000";
        // ctx.fillRect(0,0,150,75);

        let img1 = new Image()
        img1.src = '<%=bgImg%>'
        img1.onload = function () {
            ctx.drawImage(img1, 0, 0);

            let img2 = new Image
            img2.src = "<%=img%>"
            img2.onload = function () {
                ctx.drawImage(img2, 157.5, 150);
                ctx.font = "30px Arial";
                ctx.fillStyle="#FFFFFF";
                ctx.fillText('<%=text%>', 157.5, 130);
            }
        }


    </script>
</body>

</html>